package com.lagou.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.lagou.entity.User;
import com.lagou.mapper.UserMapper;
import com.lagou.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service //暴露服务, 并注册到zookeeper中
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public int register(User user) {
        return userMapper.register(user);
    }

    @Override
    public int deleteUser(Integer id) {
        return userMapper.deleteUser(id);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public List<User> findAll(String keyword) {
        return userMapper.findAll(keyword);
    }

    @Override
    public User findById(Integer id) {
        return userMapper.findById(id);
    }
}
